<script>
$(function(){
	$(".get-code-btn").click(function(){
		$(".adv-code").hide();
		$(this).parents("tr:first").find(".adv-code").show()
	})

	$(".adv-code textarea").mouseover(function(){
		this.select();
	})
});
</script>
<div id="adv-texts">
	<div class="block">
		<div class="block-title"><?php echo str_ireplace("www.", "", $website->domain) ?> - Text Links</div>
		<div class="block-body">
			<table>
			<?php foreach ($advs as $k => $adv):
				$data = unserialize($adv['data']);
				$data["descrip"] = trim($data['descrip']);
				?>
				<tr>
					<td>
						<a href="<?php echo $adv["url"]?>" target="_blank"><?php echo $data["title"]?></a>
						<p><?php echo $data["descrip"]?></p>
						<div class="adv-code" style="display:none">
							<textarea rows="4" cols="50" style="margin-left: 10px;"><?php echo "<!-- BEGIN QpidAffiliate LINKS CODE --><a href='{$adv['url']} target='_blank' title='{$data['title']}'>{$data['title']}</a><p>{$data[descrip]}</p><!--END QpidAffiliate LINKS CODE-->"; ?>
							</textarea>
							<br />Copy and paste the code onto your website and earn commission now!
						</div>
					</td>
					<td>
						<input class="get-code-btn" type="button" value="Get Code" />
					</td>
				</tr>
			<?php endforeach;?>
			</table>
		</div>
	</div>
</div>